
% % bare_conf.tex % V1.3 % 2007/01/11 % by Michael Shell % See: %
% http://www.michaelshell.org/ % for current contact information. % % This is a
% skeleton file demonstrating the use of IEEEtran.cls % (requires IEEEtran.cls
% version 1.7 or later) with an IEEE conference paper. % % Support sites: %
% http://www.michaelshell.org/tex/ieeetran/ %
% http://www.ctan.org/tex-archive/macros/latex/contrib/IEEEtran/ % and %
% http://www.ieee.org/

% %************************************************************************* %
% Legal Notice: % This code is offered as-is without any warranty either
% expressed or % implied; without even the implied warranty of MERCHANTABILITY
% or % FITNESS FOR A PARTICULAR PURPOSE! % User assumes all risk. % In no event
% shall IEEE or any contributor to this code be liable for % any damages or
% losses, including, but not limited to, incidental, % consequential, or any
% other damages, resulting from the use or misuse % of any information contained
% here. % % All comments are the opinions of their respective authors and are
% not % necessarily endorsed by the IEEE. % % This work is distributed under the
% LaTeX Project Public License (LPPL) % ( http://www.latex-project.org/ )
% version 1.3, and may be freely used, % distributed and modified. A copy of the
% LPPL, version 1.3, is included % in the base LaTeX documentation of all
% distributions of LaTeX released % 2003/12/01 or later. % Retain all
% contribution notices and credits. % ** Modified files should be clearly
% indicated as such, including  ** % ** renaming them and changing author
% support contact information. ** % % File list of work: IEEEtran.cls,
% IEEEtran_HOWTO.pdf, bare_adv.tex, %                    bare_conf.tex,
% bare_jrnl.tex, bare_jrnl_compsoc.tex
% %*************************************************************************

% *** Authors should verify (and, if needed, correct) their LaTeX system  ***
% *** with the testflow diagnostic prior to trusting their LaTeX platform ***
% *** with production work. IEEE's font choices can trigger bugs that do  ***
% *** not appear when using other class files.                            ***
% The testflow support page is at: http://www.michaelshell.org/tex/testflow/



% Note that the a4paper option is mainly intended so that authors in countries
% using A4 can easily print to A4 and see how their papers will look in print -
% the typesetting of the document will not typically be affected with changes in
% paper size (but the bottom and side margins will). Use the testflow package
% mentioned above to verify correct handling of both paper sizes by the user's
% LaTeX system.  Also note that the "draftcls" or "draftclsnofoot", not "draft",
% option should be used if it is desired that the figures are to be displayed in
% draft mode.
\documentclass[conference]{IEEEtran}
% Add the compsocconf option for Computer Society conferences.  If IEEEtran.cls
% has not been installed into the LaTeX system files, manually specify the path
% to it like: \documentclass[conference]{../sty/IEEEtran}





% Some very useful LaTeX packages include: (uncomment the ones you want to load)


% *** MISC UTILITY PACKAGES ***  \usepackage{ifpdf} Heiko Oberdiek's ifpdf.sty
% is very useful if you need conditional compilation based on whether the output
% is pdf or dvi. usage: \ifpdf % pdf code \else % dvi code \fi The latest
% version of ifpdf.sty can be obtained from:
% http://www.ctan.org/tex-archive/macros/latex/contrib/oberdiek/ Also, note that
% IEEEtran.cls V1.7 and later provides a builtin \ifCLASSINFOpdf conditional
% that works the same way. When switching from latex to pdflatex and vice-versa,
% the compiler may have to be run twice to clear warning/error messages.




\usepackage{cite}

% *** CITATION PACKAGES ***  \usepackage{cite} cite.sty was written by Donald
% Arseneau V1.6 and later of IEEEtran pre-defines the format of the cite.sty
% package \cite{} output to follow that of IEEE. Loading the cite package will
% result in citation numbers being automatically sorted and properly
% "compressed/ranged". e.g., [1], [9], [2], [7], [5], [6] without using cite.sty
% will become [1], [2], [5]--[7], [9] using cite.sty. cite.sty's \cite will
% automatically add leading space, if needed. Use cite.sty's noadjust option
% (cite.sty V3.8 and later) if you want to turn this off. cite.sty is already
% installed on most LaTeX systems. Be sure and use version 4.0 (2003-05-27) and
% later if using hyperref.sty. cite.sty does not currently provide for
% hyperlinked citations. The latest version can be obtained at:
% http://www.ctan.org/tex-archive/macros/latex/contrib/cite/ The documentation
% is contained in the cite.sty file itself.






% *** GRAPHICS RELATED PACKAGES ***
\ifCLASSINFOpdf
  % \usepackage[pdftex]{graphicx} declare the path(s) where your graphic files
  % are \graphicspath{{../pdf/}{../jpeg/}} and their extensions so you won't
  % have to specify these with every instance of \includegraphics
  % \DeclareGraphicsExtensions{.pdf,.jpeg,.png}
\else
  % or other class option (dvipsone, dvipdf, if not using dvips). graphicx will
  % default to the driver specified in the system graphics.cfg if no driver is
  % specified. \usepackage[dvips]{graphicx} declare the path(s) where your
  % graphic files are \graphicspath{{../eps/}} and their extensions so you won't
  % have to specify these with every instance of \includegraphics
  % \DeclareGraphicsExtensions{.eps}
\fi
% graphicx was written by David Carlisle and Sebastian Rahtz. It is required if
% you want graphics, photos, etc. graphicx.sty is already installed on most
% LaTeX systems. The latest version and documentation can be obtained at:
% http://www.ctan.org/tex-archive/macros/latex/required/graphics/ Another good
% source of documentation is "Using Imported Graphics in LaTeX2e" by Keith
% Reckdahl which can be found as epslatex.ps or epslatex.pdf at:
% http://www.ctan.org/tex-archive/info/  latex, and pdflatex in dvi mode,
% support graphics in encapsulated postscript (.eps) format. pdflatex in pdf
% mode supports graphics in .pdf, .jpeg, .png and .mps (metapost) formats. Users
% should ensure that all non-photo figures use a vector format (.eps, .pdf,
% .mps) and not a bitmapped formats (.jpeg, .png). IEEE frowns on bitmapped
% formats which can result in "jaggedy"/blurry rendering of lines and letters as
% well as large increases in file sizes.  You can find documentation about the
% pdfTeX application at: http://www.tug.org/applications/pdftex



\usepackage{graphicx}

% *** MATH PACKAGES ***
\usepackage[cmex10]{amsmath}
% A popular package from the American Mathematical Society that provides many
% useful and powerful commands for dealing with mathematics. If using it, be
% sure to load this package with the cmex10 option to ensure that only type 1
% fonts will utilized at all point sizes. Without this option, it is possible
% that some math symbols, particularly those within footnotes, will be rendered
% in bitmap form which will result in a document that can not be IEEE Xplore
% compliant!  Also, note that the amsmath package sets \interdisplaylinepenalty
% to 10000 thus preventing page breaks from occurring within multiline
% equations. Use: \interdisplaylinepenalty=2500 after loading amsmath to restore
% such page breaks as IEEEtran.cls normally does. amsmath.sty is already
% installed on most LaTeX systems. The latest version and documentation can be
% obtained at:
% http://www.ctan.org/tex-archive/macros/latex/required/amslatex/math/





% *** SPECIALIZED LIST PACKAGES ***
\usepackage{algorithmic}

%algorithmic.sty
% was written by Peter Williams and Rogerio Brito. This package provides an
% algorithmic environment fo describing algorithms. You can use the algorithmic
% environment in-text or within a figure environment to provide for a floating
% algorithm. Do NOT use the algorithm floating environment provided by
% algorithm.sty (by the same authors) or algorithm2e.sty (by Christophe Fiorio)
% as IEEE does not use dedicated algorithm float types and packages that provide
% these will not provide correct IEEE style captions. The latest version and
% documentation of algorithmic.sty can be obtained at:
% http://www.ctan.org/tex-archive/macros/latex/contrib/algorithms/ There is also
% a support site at: http://algorithms.berlios.de/index.html Also of interest
% may be the (relatively newer and more customizable) algorithmicx.sty package
% by Szasz Janos:
% http://www.ctan.org/tex-archive/macros/latex/contrib/algorithmicx/




% *** ALIGNMENT PACKAGES ***  \usepackage{array} Frank Mittelbach's and David
% Carlisle's array.sty patches and improves the standard LaTeX2e array and
% tabular environments to provide better appearance and additional user
% controls. As the default LaTeX2e table generation code is lacking to the point
% of almost being broken with respect to the quality of the end results, all
% users are strongly advised to use an enhanced (at the very least that provided
% by array.sty) set of table tools. array.sty is already installed on most
% systems. The latest version and documentation can be obtained at:
% http://www.ctan.org/tex-archive/macros/latex/required/tools/


% \usepackage{mdwmath} \usepackage{mdwtab} Also highly recommended is Mark
% Wooding's extremely powerful MDW tools, especially mdwmath.sty and mdwtab.sty
% which are used to format equations and tables, respectively. The MDWtools set
% is already installed on most LaTeX systems. The lastest version and
% documentation is available at:
% http://www.ctan.org/tex-archive/macros/latex/contrib/mdwtools/


% IEEEtran contains the IEEEeqnarray family of commands that can be used to
% generate multiline equations as well as matrices, tables, etc., of high
% quality.


% \usepackage{eqparbox} Also of notable interest is Scott Pakin's eqparbox
% package for creating (automatically sized) equal width boxes - aka "natural
% width parboxes". Available at:
% http://www.ctan.org/tex-archive/macros/latex/contrib/eqparbox/





% *** SUBFIGURE PACKAGES *** \usepackage[tight,footnotesize]{subfigure}
% subfigure.sty was written by Steven Douglas Cochran. This package makes it
% easy to put subfigures in your figures. e.g., "Figure 1a and 1b". For IEEE
% work, it is a good idea to load it with the tight package option to reduce the
% amount of white space around the subfigures. subfigure.sty is already
% installed on most LaTeX systems. The latest version and documentation can be
% obtained at:
% http://www.ctan.org/tex-archive/obsolete/macros/latex/contrib/subfigure/
% subfigure.sty has been superceeded by subfig.sty.



% \usepackage[caption=false]{caption} \usepackage[font=footnotesize]{subfig}
% subfig.sty, also written by Steven Douglas Cochran, is the modern replacement
% for subfigure.sty. However, subfig.sty requires and automatically loads Axel
% Sommerfeldt's caption.sty which will override IEEEtran.cls handling of
% captions and this will result in nonIEEE style figure/table captions. To
% prevent this problem, be sure and preload caption.sty with its "caption=false"
% package option. This is will preserve IEEEtran.cls handing of captions.
% Version 1.3 (2005/06/28) and later (recommended due to many improvements over
% 1.2) of subfig.sty supports the caption=false option directly:
% \usepackage[caption=false,font=footnotesize]{subfig}  The latest version and
% documentation can be obtained at:
% http://www.ctan.org/tex-archive/macros/latex/contrib/subfig/ The latest
% version and documentation of caption.sty can be obtained at:
% http://www.ctan.org/tex-archive/macros/latex/contrib/caption/




% *** FLOAT PACKAGES ***  \usepackage{fixltx2e} fixltx2e, the successor to the
% earlier fix2col.sty, was written by Frank Mittelbach and David Carlisle. This
% package corrects a few problems in the LaTeX2e kernel, the most notable of
% which is that in current LaTeX2e releases, the ordering of single and double
% column floats is not guaranteed to be preserved. Thus, an unpatched LaTeX2e
% can allow a single column figure to be placed prior to an earlier double
% column figure. The latest version and documentation can be found at:
% http://www.ctan.org/tex-archive/macros/latex/base/



% \usepackage{stfloats} stfloats.sty was written by Sigitas Tolusis. This
% package gives LaTeX2e the ability to do double column floats at the bottom of
% the page as well as the top. (e.g., "\begin{figure*}[!b]" is not normally
% possible in LaTeX2e). It also provides a command: \fnbelowfloat to enable the
% placement of footnotes below bottom floats (the standard LaTeX2e kernel puts
% them above bottom floats). This is an invasive package which rewrites many
% portions of the LaTeX2e float routines. It may not work with other packages
% that modify the LaTeX2e float routines. The latest version and documentation
% can be obtained at:
% http://www.ctan.org/tex-archive/macros/latex/contrib/sttools/ Documentation is
% contained in the stfloats.sty comments as well as in the presfull.pdf file. Do
% not use the stfloats baselinefloat ability as IEEE does not allow
% \baselineskip to stretch. Authors submitting work to the IEEE should note that
% IEEE rarely uses double column equations and that authors should try to avoid
% such use. Do not be tempted to use the cuted.sty or midfloat.sty packages
% (also by Sigitas Tolusis) as IEEE does not format its papers in such ways.





% *** PDF, URL AND HYPERLINK PACKAGES ***  \usepackage{url} url.sty was written
% by Donald Arseneau. It provides better support for handling and breaking URLs.
% url.sty is already installed on most LaTeX systems. The latest version can be
% obtained at: http://www.ctan.org/tex-archive/macros/latex/contrib/misc/ Read
% the url.sty source comments for usage information. Basically,
% \url{my_url_here}.

% \usepackage[utf8]{inputenc}
\usepackage{multirow}
\usepackage{listings}
\usepackage{comment}
\lstset{language=Java,captionpos=b,tabsize=1,frame=lines,numbers=left,basicstyle=\scriptsize,
numbersep=4pt,breaklines=true,showstringspaces=false,emph={label}}
\usepackage[stable]{footmisc}



% *** Do not adjust lengths that control margins, column widths, etc. *** *** Do
% not use packages that alter fonts (such as pslatex).         *** There should
% be no need to do such things with IEEEtran.cls V1.6 and later. (Unless
% specifically asked to do so by the journal or conference you plan to submit
% to, of course. )


% correct bad hyphenation here
\hyphenation{op-tical net-works semi-conduc-tor}
\newcommand{\tool}{SEGMENT}
%\pagestyle{plain}
%\pagenumbering{arabic}

\IEEEoverridecommandlockouts

\newcommand{\HRule}{\rule{\linewidth}{0.5mm}}

\newcommand{\para}[1]{\vskip 0.5em\noindent\textbf{#1.}}
\newcommand{\gline}{\rule{\columnwidth}{.2pt}\\}
\newcommand{\code}[1]{\textsf{#1}}

\renewcommand{\thefootnote}{\fnsymbol{footnote}}

\begin{document}

%
% paper title
% can use linebreaks \\ within to get better formatting as desired
\title{Applying Vector Space Model to Improve Feature Location in
Software Maintenance}


\author{\IEEEauthorblockN{Xiaoran Wang
and Kaidi Ma}
\IEEEauthorblockA{Computer and Information Sciences\\
University of Delaware\\
Newark, DE 19716 USA\\
\{xiaoran, kdma\}@udel.edu}
}

\maketitle

%\IEEEcompsoctitleabstractindextext{%
\begin{abstract}

In this report, we present an implementation of Vector Space Model (VSM) for
feature location. Through this study, we learned what VSM is and how it works
for matching a query vector and document vector.  We compare our result with the
sample output data offered in the project handout and find that they are the
same. The main contributions of this project include 1) A light-weight Java
implementation of VSM  and 2) an evaluation which compare naive approach with
VSM.

\end{abstract}
% IEEEtran.cls defaults to using nonbold math in the Abstract.
% This preserves the distinction between vectors and scalars. However,
% if the journal you are submitting to favors bold math in the abstract,
% then you can use LaTeX's standard command \boldmath at the very start
% of the abstract to achieve this. Many IEEE journals frown on math
% in the abstract anyway. In particular, the Computer Society does
% not want either math or citations to appear in the abstract.

% Note that keywords are not normally used for peerreview papers.
\begin{IEEEkeywords}
VSM, Information Retrieval.
\end{IEEEkeywords}





\section{Introduction}
Due to the reason that a system may contain huge amount of code files, it is
difficult to maintain a software system for a new developer. In order to
complete a maintenance task, it is important to locate the correct place (i.e.,
the correct files, classes, methods, etc.) to make the changes. If such process
is done manually, the developer may search the code files with key words to
locate a function or variable. By using Vector Space Model (VSM) as a Feature
Location Technique (i.e., the process of finding artifacts such as methods,
classes or files that are related to a particular maintenance task), a
semi-automatic approach to this problem that could make the process more
efficient and offer more accurate searching results. A maintenance task can be converted to a
textual description which is used as a query for the VSM Feature Location
Technique. The technique will find a list of ranked methods that contain terms
most similar to the maintenance description.

In the remainder of this paper, Section 2 describes the proposed solution. Then
Section 3 presents the evaluation of this study. Finally Section 4 shows the
conclusion of this study.
The dataset used, source code of this project and the generated CVS file are
available at:
http://code.google.com/p/cis879p1/\cite{gcode}(No
authentication requried for checkout).

\section{Proposed Solution}

\subsection{Vector Space Model (VSM)}

Vector Space Model is a model for representing text
documents as vectors of identifiers. If a text-based function and user query can
be represented using $m$-dimensional vectors, where $m$ is the total number of
distinct terms in the corpus, we are able to compute a cosine similarity between
these two vectors. If the function vector and the query vector show higher
similarity, the higher chance that the function is the correct location needed
to be maintained.

From the handout[3], we know that all the terms that describe a function are
maintained in a function document.  A collection of n documents can be
represented in the VSM by a Term-Document matrix, which has $n$
rows corresponding to the documents and m columns corresponding to the terms.

$w_{ij}$ in the matrix is the “weight” of the term $j$ in the document $i$. If
its value is zero, that means the term is not important or it is not found in the document. In this study, we use term frequency-inverse document frequency as the
“weight”. By using such weight, the more frequent a term occurs within a
document, the more relevant that term is to the semantics of the document. On
the other hand, the less frequent a term occurs within all the documents, the
more that term has a discriminative influence. ). The degree of similarity
between a document $d$ and a query $q$ is calculated using cosine similarity between
two vectors.
\subsection{Applying VSM}

{\bf I). Input Data:}
Two types of input data are given in this project. One type is about Methods
while the other one is about Query. There are total 6,413 documents (methods) in
the corpus, which means that 6,413 lines in the files
CorpusMethods-jEdit4.3-AfterSplitStopStem.txt and
CorpusMethods-jEdit4.3.mapping. For the Query, there are 150 features, which
also means there are 150 queries (in the file
CorpusQueries-jEdit4.3-AfterSplitStopStem.txt) and 150 sets of methods
associated with these features (found in the folder jEdit4.3GoldSets). Since the
corpus is already generated by previous pre-process. The corpus does not contain
non-literals, split identifiers, Capital case or suffixes form.

(1) for Methods:

There are two files to represent the documents. One is
CorpusMethods-jEdit4.3-AfterSplitStopStem.txt, which contains the preprocessed
corpus (i.e., after removing non-literals, after splitting identifiers and
stemming the words) of the jEdit system. Each line of this file represents a
document (i.e., a method). The other one is CorpusMethods-jEdit4.3.mapping,
which contains the methodIDs (i.e., the identifier of the method consisting of
the package name, class name, method name and signature) from the corpus. The
methodID from line $i$ corresponds to the method on line $i$ from the file
orpusMethods-jEdit4.3-AfterSplitStopStem.txt.

(2) for Query:

One file is CorpusQueries-jEdit4.3-AfterSplitStopStem.txt, which contains the
queries (i.e., set of words describing the maintenance tasks). Each query is
associated with a unique feature. The query on line $i$ is associated with the
feature that has the featureID on line $i$ in file jEdit4.3ListOfFeatureIDs.txt.
Another file is file jEdit4.3ListOfFeatureIDs.txt, which contains the
featureIDs of 150 features that will be used in the evaluation. The featureIDs
are represented by a unique number (e.g., 950961, 1193683, etc.). In
addition, there is a folder jEdit4.3GoldSets, which contains 150 files with
the name GoldSet[featureID].txt (e.g., GoldSet950961.txt). The featureID is
one of the featureIDs found in the file jEdit4.3ListOfFeatureIDs.txt. Each of
the 150 files contains a list of methodIDs (same as the ones found in the file
CorpusMethods-jEdit4.3.mapping) which are related to the feature featureID.

{\bf II). Process }

Step 1: Generate Term-Document matrix

We scan the file CorpusMethods-jEdit4.3-AfterSplitStopStem.txt line by line to get all the
distinct terms that appear in all methods. Since one line represents one method,
at the meantime when we read one line from the file, we also calculate the
frequency of each term in the method. That is the frequency of term $j$ in method
$i$.

Step 2: Normalize the Term-Document matrix

At the very end of line scanning, we
select out the maximum frequency of the term inside a method and compute the
normalized term-document frequency, by using the formula: $tf_{ij}=\frac{f_{ij}}{Max\{f_{ij}\}}$

Step 3: Compute document frequencies

We also count the document frequency during the line
scanning. By the end of scanning file
CorpusMethods-jEdit4.3-AfterSplitStopStem.txt, we get the document frequencies
$df_i$ matrix.

Step 4: Compute inverse document frequencies

When we finish scanning the file
CorpusMethods-jEdit4.3-AfterSplitStopStem.txt, we already have term
frequencies for each method and the document frequency. The next step is to compute
the inverse document frequency $idf_j$ of each term using the $idf_{ij}=ln(\frac{6413}{df_i})$, where $i$ is method $i$ and $j$ is term $j$ .

Step 5: Generate tf-idf weighted matrix

Having all the term frequencies (from
Step 2) and the inverse document frequencies (from Step 4), we compute the
tf-idf weight $w_{ij}$ by using the formula  $w_{ij} = tf_{ij} * idf_j = tf_{ij} * ln(\frac{6413}{df_i})$ We
also get all the terms that appears in all methods. Based on these terms, we
generate document vector (method vector) $Vd, Vd  = < w_{j1}, w_{j2},w_{j3},\cdots, w_{jM} >$,
where $j$ is document $j$ and $M$ is the total number of terms.

Step 6: Compute similarities between a query and all documents.

a. Represent a query as a vector

We scan the file CorpusQueries-jEdit4.3-AfterSplitStopStem.txt line by line to get a vector of
terms in a query. The weight of each distinct term is equal to the number of
times the term appears in the query. The query vector has the same dimension as
all the other documents from the weighted matrix. let Vq denote the query
vector, $Vq = < w_1 ,w_2 ,w_3,\cdots,w_M >$ where $w_1 ,w_2 ,w_3,\cdots,w_M$  are the number of
times the term appears in the query, $M$ is the total number of terms.
The dimension is found after CorpusMethods-jEdit4.3-AfterSplitStopStem.txt
scanning.

b. Compute cosine similarity

Next step, based on the corresponding
featureID, we find out all the method associated with the featureID in the
folder jEdit4.3GoldSets and compute the cosine similarity between the query and
each associated method by using the formula:
$sim(Vq, Vd) = \frac{Vq \cdot Vd}{||Vq||\cdot||Vd||}$

c. Generate ranked list

Based on the similarities we
computed in Step 6.c, we sort the methods found by featureID into descending
order. Then we assign the top method as rank 1.

\section{Evaluation}




This section presents the design of the case study, results and discussion.

\subsection{Systems and Benchmarks}

To evaluate the effectiveness of VSM, we use jEdit4.3 as our subject project. It
contains 6413 methods. Our VSM calculation program is built in Java and tested
on Ubuntu 12 running on Intel i7 2600 with 8G memory. All source code is
available at~\cite{gcode}.

For benchmark, the project designer has annotated the gold set for 150 features.
Each feature has a corresponding set of methods. Each of those methods have a
corresponding line number. The number can represent the steps dvelopers need to
find the targetted method. Even though scanning from the beginning is not what
developers do in reality, the number can still be used for comparision.

\subsection{Data analysis}

Our VSM calculation program takes input as a bag of method words and a bag of
query words, and returns the calculation of similarity scores and rankings for
each method. Figure 2 in Appendix B shows the output data for feature with ID
1730845. In this table, the first column is the feature ID, the
second column is the position from the original method mapping file, the
third column is the method’s signature, the fourth column is the ranking in
the result of VSM for each method, and the last column is the best rank for
each feature. Note that this is only one example of the results, and the
complete results in cvs file is available at [4].


\subsection{Results}

This section presents the results for the effectiveness of VSM by comparing to
the naive approach.

We compare the VSM with the naive approach which starts from the beginning of
the whole set of methods. Since the second column in Figure 2 represents this
position, we can evaluate the effectiveness of VSM by comparing the second
column with the fourth column which represents the position in the
ranked list of result.

In general, as shown in Figure 1, the rank number of method from gold
set in the query result list is lower than the original number in original file. After
excluding the method from gold set that does not actually exist, we have 684
methods for analysis.

Table 1 shows the descriptive statistics of the results. The first
row is the result of using VSM and the second row is the result of using naive
approach. Figure 1 visualizes those descriptive statistics in box plot chart.
Y-axis represents the position and x-axis represents different approach: VSM and Naive.

On average, VSM takes 256 steps to find the target feature while naive approach
takes 3210 steps. In addition, the difference is significant enough to conclude
that VSM outperforms naive approach.

  \begin{table*}[htp]
	\caption{Descriptive Statics of Results}
\centering
	\begin{tabular}{| l | l | l | l | l | l | l| l|}
	\hline		
	  		 	
		& {\bf Min} &{\bf  25\%} & {\bf Median} &{\bf 75\%} &{\bf  Max} &{\bf  Mean}
		&{\bf St.
		Dev.}\\
		\hline	 		
		Position in Ranking Result of VSM &1 & 43 & 133&554&973& 256& 968.78\\ \hline
		Position in Method File & 52 &1964 &2759 &4771 &6139 &3210 &1740.53\\ \hline
	\end{tabular}
	\label{table:dep}
	\end{table*}


\begin{figure}[htp]
\begin{center}
\includegraphics[height=66mm]{image/vis.png}

\caption{\small \sl Box Plot of the Results
\label{fig:box}}
\end{center}
\end{figure}


\subsection{Discussion}

From Table 2 and Figure 1, it is straight forward to conclude that VSM
outperforms the naive approach. The average steps to find a result by using VSM
is 256, while by using naive approach it is 3210.



\section{Conclusion}

In this project, we implement VSM by using Java and evaluate VSM effectiveness.
From analyses of our evaluation results, VSM performs better than the naive
approach.

We notice that even VSM performs better than the naive approach, it alone is
not an approach that is good enough for developers to use. For example, the average posion of the correct results is 256. That
means 256 steps to determine if query result is what they need. This is not
realistic. In the future, we will combine program package and class information
and developers' background knowledge to get more precise view of how VSM works
for real feature location tasks. As VSM is a very basic method in information
retrieval, it is necessary to compare it with other methods such as LDA, LSI, etc.




\appendices
\section{Implementation Details}

Since we find that each method contains very limited number of terms. Using
sparse matrix to represent the tf-idf weighted matrix is a good choice.

We use java.util.LinkedList of HashMap to represent the
tf-idf weighed matrix java.util.LinkedList of HashMap tf to
represent all the tf’s for all methods
For each method(document), we use
HashMap gt df to represent document frequency
HashMap idf to represent inverse document frequency
For each feature(query), we use
HashMap queryVector to represent query vector

The whole process is containing three main parts. One is calculateTfIdf(). Its
main task is to scan the file CorpusMethods-jEdit4.3-AfterSplitStopStem.txt
and generates the tf-idf matrix.
Second part is readQueryAndMethodIDs(). In this step, it reads
CorpusQueries-jEdit4.3-AfterSplitStopStem.txt line by line and finds the
methods associated using the feature ID in the corresponding GoldSet folder. It
creates the query vector when reading one line in the file
CorpusQueries-jEdit4.3-AfterSplitStopStem.txt.
The third and the final step is calculateSimsFromQryFile().In this step, it
compute the cosine similarity between each query vector and the corresponding
method vector. It then generates a ranked list of gold set methods based on
their similarities to the featureID query.


% you can choose not to have a title for an appendix
% if you want by leaving the argument blank
\section{ Example Expreiment Result for Feature with ID 1730845}

The following figure is a snapshot of the generated cvs file. It contains
results for the feature with ID of 1730845. All complete results are available
at~\cite{gcode}.

 \begin{figure}[htp]
\begin{center}
\includegraphics[height=66mm]{image/example.png}

\caption{\small \sl Example Expreiment Result for Feature with ID 1730845
\label{fig:ex}}
\end{center}
\end{figure}





% trigger a \newpage just before the given reference
% number - used to balance the columns on the last page
% adjust value as needed - may need to be readjusted if
% the document is modified later
%\IEEEtriggeratref{8}
% The "triggered" command can be changed if desired:
%\IEEEtriggercmd{\enlargethispage{-5in}}

% references section

% can use a bibliography generated by BibTeX as a .bbl file
% BibTeX documentation can be easily obtained at:
% http://www.ctan.org/tex-archive/biblio/bibtex/contrib/doc/
% The IEEEtran BibTeX style support page is at:
% http://www.michaelshell.org/tex/ieeetran/bibtex/
%\bibliographystyle{IEEEtran}
% argument is your BibTeX string definitions and bibliography database(s)
%\bibliography{IEEEabrv,../bib/paper}
%
% <OR> manually copy in the resultant .bbl file
% set second argument of \begin to the number of references
% (used to reserve space for the reference number labels box)
\begin{thebibliography}{1}


\bibitem{eason}
G. Eason, B. Noble, and I. N. Sneddon, \emph{On certain integrals of
Lipschitz-Hankel type involving products of Bessel functions,} Phil. Trans. Roy.
Soc. London, vol. A247, pp. 529–551, April 1955.

\bibitem{Maxwell}
J. Clerk Maxwell, \emph{A Treatise on Electricity and Magnetism}, 3rd ed., vol.
2. Oxford: Clarendon, 1892, pp.68–73.

\bibitem{Handout}
\emph{CISC 879 Text Analysis for Software Engineering Project\#1 Handout}

\bibitem{gcode}
\emph{http://code.google.com/p/cis879p1/source/checkout}

\end{thebibliography}



% that's all folks
\end{document}

